let name = '霹卡霹卡霹卡'
let address = 'fushun'
let sentence = 'this is a book'
let arr = sentence.split(' ')//用空格来分割
console.log(arr)

let email = '2291186374@qq.com'
let arr2 = email.split('@')
console.log(arr2[0])
console.log(arr2[1])

let nums = '1,2,3,4,5'
let arr3 = nums.split(',')
let result = 0
for (let a=0;a<arr3.length;a++)
    {
        result += parseInt(arr3[a])
    }
console.log(result)

let age = 21

let info = name + '的家乡是' + address + '，' + age + '岁'
let info2 = `${name}的家乡是${address}，${age}岁`
// console.log(info)
// console.log(info2)
// console.log(name[1])
// for (let i = 0;i < name.length;i++)//第一种遍历数组的方法
//     {
//         console.log(name[i])
//     }
// for (let c of name)//第二种遍历数组的方法
//     {
//         console.log(c)
//     }